<!DOCTYPE html>
<html>
   <head>
      <title>我的产量查询</title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0 Access-Control-Allow-Origin:*">
      <!-- 引入 Bootstrap -->
      <!--<link href="<?=base_url('html/bootstrap_v3/css/bootstrap.css')?>" rel="stylesheet">-->
      <link href="<?=base_url('html/bootstrap_v3/css/bootstrap.css')?>" rel="stylesheet">
      <link href="<?=base_url('html/bootstrap_v3/datepicker/css/bootstrap-datetimepicker.min.css')?>" rel="stylesheet">
      <!--<link href="<?=base_url('html/bootstrap_v3/css/bootstrap-glyphicons.css')?>" rel="stylesheet">-->
      <script src="<?=base_url('html/js/jquery-1.8.3.min.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/js/bootstrap.min.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/datepicker/js/bootstrap-datetimepicker.js')?>"></script>
      <script src="<?=base_url('html/bootstrap_v3/datepicker/js/locales/bootstrap-datetimepicker.zh-CN.js')?>"></script>
      
      <!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
      <!-- 注意： 如果通过 file://  引入 Respond.js 文件，则该文件无法起效果 -->
      <!--[if lt IE 9]>
         <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
         <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
      <![endif]-->
      <style type="text/css">
          .body{background-color: #f5f5f5;}
          .showimg{background: url("../html/image/PersonInfo.png") center repeat;height:12em; margin-bottom:20px;}
          .margin_left{margin-left: 0.3em;}
          .margin_right{margin-right: 0.5em;}
          .float-right{float: right;}
          .small{height: 20px;width: 20px;}
          .page_edit{display: none;}
          .margin-bottom30{margin-bottom: 20px;}
      </style>
   </head>
   <body>
       <?php if($status=='show'):?>
       <div  class="text-center" style="font-weight:bold;font-size:2em;">
            我的产量
        </div>
       <div>
           <div class="list-group">
                <div class="list-group-item">
                    <span class="margin_left">姓名</span><span class="margin_right float-right"><?=$username?></span>
                    <div><input type="text" style="display: none" id="username" value="<?=$username?>"></div>
                </div>
                <div class="list-group-item">
                    <span class="margin_left">工号</span><span class="margin_right float-right"><?=$workid?></span>
                    <div><input type="text" style="display: none" id="workid" value="<?=$workid?>"></div>
                </div>
                <div class="list-group-item">
                    <span class="margin_left">开始日期</span><input type="text" name="startDate" value="<?=$startDate?>" id='startDate' class="float-right">
                </div>
                <div class="list-group-item">
                    <span class="margin_left">结束日期</span><input type="text" name="endDate" value="<?=$endDate?>" id='endDate' class="float-right">
                </div>
               <div>
                   <button id="search" type="button" class="btn btn-primary btn btn-block" style="margin-top: 10px;">
                        查询
                    </button>
               </div>
                
           </div>
       </div>
       <?php elseif($status=='success'):?>
       <div style="display: none;"><input id="workid" type="text" value="<?=$resData[0]['工号']?>"></div>
        <div class="text-center" style="font-weight:bold;font-size:2em;">
            我的产量
        </div>
        <table class="table  table-bordered">
            <tbody>
                <tr>
                    <td>员工姓名</td>
                    <td><?=$resData[0]['姓名']?></td>
                 </tr>
                 <tr>
                    <td>员工工号</td>
                    <td><?=$resData[0]['工号']?></td>
                 </tr>
                 <tr>
                    <td>开始时间</td>
                    <td><?=$startDate?></td>
                 </tr>
                 <tr>
                    <td>结束时间</td>
                    <td><?=$endDate?></td>
                 </tr>
            </tbody>
        </table>
   <hr>
        <table class="table  table-bordered">
            <thead>
                <tr>
                   <th>产品</th>
                   <th>产品名称</th>
                   <th>工序名称</th>
                   <th>数量</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($resData as $value):?>
                    <tr>
                        <td><?=$value['产品']?></td>
                        <td><?=$value['产品名称']?></td>
                        <td><?=$value['工序名称']?></td>
                        <td><?=$value['数量']?></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        <div>
            <button id="back" type="button" class="btn btn-primary btn btn-block" style="margin-top: 10px;margin-bottom: 20px;">
                 返回
             </button>
        </div>
       <?php elseif($status=='faild'):?>
       <div style="color: red;">对不起，无法查询到你的报工信息，请确认你的查询信息！</div>
       <?php endif;?>
       
       <script>
            $(document).ready(function(){
                $("#search").click(function(){
                    var username = $("#username").val();
                    var workid   = $("#workid").val();
                    var startDate= $("#startDate").val();
                    var endDate  = $("#endDate").val();
                    window.location.href = "<?=  base_url('baogong/getOutputInfo?username=')?>"+username+"&workid="+workid+"&startDate="+startDate+"&endDate="+endDate;
                });
                $("#back").click(function(){
                    var username = $("#username").val();
                    var workid   = $("#workid").val();
                    var startDate= $("#startDate").val();
                    var endDate  = $("#endDate").val();
                    window.location.href = "<?=  base_url('baogong/backMyOutput?workid=')?>"+workid;
                })
            })
           
       </script>
       
       <script type="text/javascript">
            $('#startDate').datetimepicker({
              minView:"month",
              format:'yyyy/mm/dd H:i:s',
              language: 'zh-CN',
              weekStart: 1,
              todayBtn: 1,
              autoclose: 1,
              todayHighlight: 1,
              startView: 2,
              forceParse: 0,
              showMeridian: 1
            });
            
            $('#endDate').datetimepicker({
              minView:"month",
              format:'yyyy/mm/dd H:i:s',
              language: 'zh-CN',
              weekStart: 1,
              todayBtn: 1,
              autoclose: 1,
              todayHighlight: 1,
              startView: 2,
              forceParse: 0,
              showMeridian: 1
            });
    </script>
   </body>
</html>